<extend name="./public/frame.html"/>
<block name="content">
    <form class="layui-form" action="{:url('submits')}" method="post">
        <input type="hidden" name="k_id" value="{$k_config['id']}"/>
        <input type="hidden" name="s_id" value="{$s_config['id']}"/>
        <table class="layui-table">
            <tr>
                <td colspan="2">
                    <table class="layui-table">
                        <tr>
                            <td style="font-weight: bold;color: black; background:#F8F8F8" colspan="2">
                                <input type="text" class="layui-input" readonly value="快车防刷单机制" style="border: 0px;width: 30%;float: left;background:#F8F8F8">
                                <input type="checkbox" name="k_checkbox" data-type="" lay-skin="switch" lay-filter="switchCheck" class="check" lay-text="开启|关闭" value="{$k_config['is_use']}" <if condition="$k_config['is_use'] eq 1">checked</if>>
                                <input type="hidden" name="k_is_use" value="{$k_config['is_use']}">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">异常单数上限（单）</td>
                            <td><input class="layui-input" name="k_abnormal_order_num" type="text" value="{$k_config['abnormal_order_num']}" lay-verify="required|number" onkeyup="value=value.replace(/[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">刷单限制天数（天）</td>
                            <td><input class="layui-input" name="k_abnormal_limit_days" type="text" value="{$k_config['abnormal_limit_days']}" lay-verify="required|number" onkeyup="value=value.replace(/[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">起点位置异常范围（米）</td>
                            <td><input class="layui-input" name="k_start_abnormal_range" type="text" value="{$k_config['start_abnormal_range']}" lay-verify="required|number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">终点位置异常范围（米）</td>
                            <td><input class="layui-input" name="k_end_abnormal_range" type="text" value="{$k_config['end_abnormal_range']}" lay-verify="required|number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">行驶里程异常范围（%）</td>
                            <td><input class="layui-input" name="k_travel_abnormal_range" type="text" value="{$k_config['travel_abnormal_range']}" lay-verify="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">订单实际行驶距离小于（m）</td>
                            <td><input class="layui-input" name="k_driving_distance" type="text" value="{$k_config['driving_distance']}" lay-verify="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">订单实际行驶时间（秒）</td>
                            <td><input class="layui-input" name="k_travel_time" type="text" value="{$k_config['travel_time']}" lay-verify="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">乘客上车时间（秒）</td>
                            <td><input class="layui-input" name="k_board_time" type="text" value="{$k_config['board_time']}" lay-verify="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">白名单配置<p style="color: red;">(填入司机uid，以英文逗号隔开)</p></td>
                            <td>
                                <textarea name="k_whitelist" class="layui-textarea" id="">{$k_config['whitelist']}</textarea>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="width: 12.7%;text-align: center;">快车异常订单金额冻结</td>
                <td>
                    <input type="checkbox" name="k_checkboxabnormal" data-type="" lay-skin="switch" lay-filter="switchCheckAbnormal" class="check" lay-text="开启|关闭" value="{$k_config['is_abnormal']}" <if condition="$k_config['is_abnormal'] eq 1">checked</if>>
                    <input type="hidden" name="k_is_abnormal" value="{$k_config['is_abnormal']}">
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table class="layui-table">
                        <tr>
                            <td style="font-weight: bold;color: black; background:#F8F8F8" colspan="2">
                                <input type="text" class="layui-input" readonly value="顺风车防刷单机制" style="border: 0px;width: 30%;float: left;background:#F8F8F8">
                                <input type="checkbox" name="s_checkbox" data-type="" lay-skin="switch" lay-filter="switch" class="check" lay-text="开启|关闭" value="{$s_config['is_use']}" <if condition="$s_config['is_use'] eq 1">checked</if>>
                                <input type="hidden" name="s_is_use" value="{$s_config['is_use']}">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">异常单数上限（单）</td>
                            <td><input class="layui-input" name="s_abnormal_order_num" type="text" value="{$s_config['abnormal_order_num']}" lay-verify="required|number" onkeyup="value=value.replace(/[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">刷单限制天数（天）</td>
                            <td><input class="layui-input" name="s_abnormal_limit_days" type="text" value="{$s_config['abnormal_limit_days']}" lay-verify="required|number" onkeyup="value=value.replace(/[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">起点位置异常范围（米）</td>
                            <td><input class="layui-input" name="s_start_abnormal_range" type="text" value="{$s_config['start_abnormal_range']}" lay-verify="required|number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">终点位置异常范围（米）</td>
                            <td><input class="layui-input" name="s_end_abnormal_range" type="text" value="{$s_config['end_abnormal_range']}" lay-verify="required|number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">行驶里程异常范围（%）</td>
                            <td><input class="layui-input" name="s_travel_abnormal_range" type="text" value="{$s_config['travel_abnormal_range']}" lay-verify="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></td>
                        </tr>
                        <tr>
                            <td style="width: 12%;text-align: center;">白名单配置<p style="color: red;">(填入司机uid，以英文逗号隔开)</p></td>
                            <td>
                                <textarea name="s_whitelist" class="layui-textarea" lay-verify="">{$s_config['whitelist']}</textarea>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>

            <!--<style>-->
                <!--.layui-form-checkbox{margin-top: 5px;}-->
            <!--</style>-->
        </table>
        <button class="layui-btn" lay-submit="submit" lay-filter="submit">提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </form>
    <script>
        layui.use(['form', 'upload'], function(){
            var form = layui.form
                ,layer = layui.layer;
            form.on('switch(switchCheck)', function(data) {
                if (!this.checked) {
                    $("input[name='k_checkbox']").val(0);
                    $("input[name='k_is_use']").attr('value', 0);
                } else {
                    $("input[name='k_checkbox']").val(1);
                    $("input[name='k_is_use']").attr('value', 1);
                }
            });
            form.on('switch(switchCheckAbnormal)', function(data) {
                if (!this.checked) {
                    $("input[name='k_checkboxabnormal']").val(0);
                    $("input[name='k_is_abnormal']").attr('value', 0);
                } else {
                    $("input[name='k_checkboxabnormal']").val(1);
                    $("input[name='k_is_abnormal']").attr('value', 1);
                }
            });
            form.on('switch(switch)', function(data){
                    if(!this.checked){
                        $("input[name='s_checkbox']").val(0);
                        $("input[name='s_is_use']").attr('value', 0);
                    }else{
                        $("input[name='s_checkbox']").val(1);
                        $("input[name='s_is_use']").attr('value', 1);
                    }
            });
        });
    </script>
</block>
